﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WebApi_ProductText1.Domain.Entity;

namespace WebApi_ProductText1.Domain
{
    public class Sell10000Context : DbContext
    {
        // 一个私有的方法，用于连接数据库
        // 私有的  覆盖 配置 db上下文选项生成器
        protected override void OnConfiguring(DbContextOptionsBuilder dbContextOptionsBuilder)
        {
            // UseSqlServer:使用Sql服务器
            dbContextOptionsBuilder.UseSqlServer("server=.;database=Sell1000;uid=sa;pwd=123456");
        }
        public DbSet<User> Users { get; set; }
        public DbSet<Product> Products { set; get; }
        public DbSet<Supplier> Suppliers { get; set; }
        public DbSet<Orderform> Orderforms { get; set; }
        public DbSet<ShoppingTrolley> ShoppingTrolleys { get; set; }


    }
}
